package cheme.ProcessEditor.Figures;

import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.LineBorder;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.draw2d.text.FlowPage;
import org.eclipse.draw2d.text.TextFlow;
import org.eclipse.gef.EditPart;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;

import cheme.ProcessEditor.Table.ListFig;



public class TooltipFig extends ListFig
{
	TextFlow tf;FlowPage fp;
	Rectangle toolTipConstraint;
	EditPart toolTipEditPart;
	public static final Color myYellow  = new Color(null, 255, 255, 153);
	
	public TooltipFig()
	{
		super();		
		
		LineBorder lnbdr = new LineBorder();
		lnbdr.setColor(ColorConstants.white);
		lnbdr.setWidth(2);
		
		Font classFont = new Font(null, "Arial", 8, SWT.BOLD);	
		
		tf = new TextFlow("");
		tf.setFont(classFont);
		tf.setForegroundColor(ColorConstants.black);
		fp = new FlowPage();
		
		fp.setBackgroundColor(myYellow);
		fp.setOpaque(true);
		fp.setBorder(lnbdr);
	    fp.add(tf);	    
	    add(fp);
	
		
	}
	
	
	public void setMessage(String text)
	{
		//tooltiplabel.setText(text);
		tf.setText(text);
	}
	
	public void setLocation(Point p)
	{
		Point location = new Point(p.x + 5, p.y+5);
		//tooltiplabel.setLocation(location);
		//tooltiplabel.setSize(100,500);
	}
	
	public void setVisibility(boolean bvisible)
	{		
		fp.setVisible(bvisible);
	}

}
